import { type baseTreeInfo } from '@/page/types/base/baseTree'
import { type pageInfo } from '@/page/types/base/baseRequestPage'

export interface goodsTypeInfo {
  id: string
  /** 父id */
  pid: string | null
  /** 类型名称 */
  name: string
  /** 类型code */
  code: string
  /** 描述 */
  describes: string
  /** 创建时间 */
  createTime: string
  /** 图标url */
  iconUrl: string
  /** 子类 */
  children: goodsTypeInfo[]
}

export interface goodsTypeS extends pageInfo {
  /** 类型名称 */
  name: string
  /** 类型code */
  code: string
}

export class goodsTypeClass {
  goodsTypes: goodsTypeS = {
    /** 类型名称 */
    name: '',
    /** 类型code */
    code: '',
    page: 1,
    size: 10,
    total: 0
  }

  treeGoodsTypes = [] as goodsTypeInfo[]
  goodsDialog = false
  goodsEidt: goodsTypeInfo = {
    id: '',
    pid: null,
    name: '',
    code: '',
    describes: '',
    createTime: '',
    children: [],
    iconUrl: ''
  }

  rules = {}
  selectGoodTypeData = [] as baseTreeInfo[]
}
